package chapter18;

import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/3/24 22:08
 */
public class FormattedMemoryInput {
    public static void readString(String file) {
        DataInputStream in = null;
        try {
            in = new DataInputStream(new ByteArrayInputStream(BufferedInputFile.read(file).getBytes()));
            while (in.available() != 0) {
                System.out.println((char) in.readByte());
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
